Skip to main content

Instruction Node

The Instruction node defines a system-level “prompt” that frames every Large Language Model (LLM) call within your chatflow. Think of it as the foundational stage direction or mission statement you provide the AI before it processes any user input. This ensures consistency, context-awareness, and control over the AI’s behavior across an entire conversation.


🔍 Overview

The Instruction node is essential when you want to:

  • Enforce consistent style, tone, and format throughout interactions.
  • Inject dynamic, session- or user-specific data such as user names, roles, or preferences.
  • Impose constraints on the AI’s responses, like limiting length or specifying output format.
  • Guide the model toward specific behaviors, e.g., role-playing as an expert tutor or assistant.

By setting these instructions once, you reduce redundancy and increase reliability in your chatbot or AI assistant’s replies.


⚙️ Configuration Options

1. Select Model

  • Field: Select Model
  • Type: Dropdown (required)
  • Options:
    • gpt-3.5-turbo: Optimized for faster responses at a lower cost. Ideal for mostly static or simple instructions.
    • gpt-4: More advanced with nuanced understanding and creativity, better for complex or role-specific prompts.

Tip: Start with GPT-3.5 for rapid prototyping and switch to GPT-4 when your application requires deeper contextual comprehension or sophistication.

Example dropdown UI snippet:

▾ Select Model  ▼ GPT-4

2. Instruction Text

  • Field: Instruction

  • Type: Rich-text or Markdown editor (required)

  • Placeholder: Enter your instruction here…

  • Behavior:

    • The text entered here is prepended to every user message sent to the model.
    • Supports Markdown formatting for clear, readable instructions (bold, italics, lists, headings).
    • If left blank or undefined, the model uses its default system prompt.

Example instruction snippet:

You are a concise assistant.
Always format answers as:
1. Summary
2. Details
3. Next steps.

This instructs the model to respond in a consistent, structured manner for all queries.


3. + Insert Menu

To enhance instructions with runtime data, use the + Insert button to inject dynamic variables from your flow context.

How it works:

  1. Click + Insert in the instruction editor toolbar.
  2. Browse the variable tree (e.g., auth.email, userName, orderId).
  3. Select a variable to insert its placeholder syntax like {{userName}}.

Example variable tree structure:

• id
• Name
• key
• …
└─ auth
├─ name
├─ displayName
└─ email

By embedding these placeholders, the model receives real-time context, personalizing or tailoring responses dynamically.


🎨 UI States

The Instruction node interface toggles between two views:

  • Collapsed View: Shows only the header “Instruction.” Clicking expands the node.

    ▸ Instruction
  • Expanded View: Displays the model selector dropdown, the instruction editor, and the + Insert button.

    ▾ Instruction
    [Select Model: GPT-4 ▼]
    [Instruction editor…]
    (+ Insert)

This design keeps the workspace clean but accessible.


🛠️ Usage Examples

1. Scoped Variables

Embed user/session info into instructions to personalize AI behavior:

You are an expert tutor. The current user is {{userName}} (role: {{auth.role}}).

2. Conditional Formatting

Guide output style conditionally based on answer length or other criteria:

If the answer is longer than 50 words, end with: "Would you like more detail?"

3. Combining Static & Dynamic Content

Mix static instructions with variables for customized outputs:

Hello, **{{userName}}**! Provide a short summary of today’s weather for {{location}}.

These examples showcase how flexible and powerful the instruction node can be.


🚀 Best Practices

  • Be Explicit: Clearly state your expectations around tone, length, or format to avoid ambiguous AI output.
  • Keep Instructions Concise: Limit to 1–3 sentences to prevent overwhelming the model.
  • Use Markdown: Utilize formatting like bold or lists for clarity and emphasis.
  • Limit Variable Injection: Only include essential variables to reduce noise and complexity.
  • Test Multiple Models: Compare GPT-3.5 and GPT-4 results to balance speed and quality.

Summary

The Instruction node is the cornerstone of controlling AI behavior in conversational flows. It sets the foundational context that shapes every interaction, ensuring consistency, personalization, and clarity.

Proper use of this node improves user experience and empowers developers to craft sophisticated AI-driven applications.